package net.rlair.es.repository;

import net.rlair.es.model.Article;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.elasticsearch.repository.ElasticsearchCrudRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * ArticleRepository.
 *
 * @author yaoyi
 * @version 1.0.0.0
 */
@Repository
public interface ArticleRepository extends ElasticsearchCrudRepository<Article, String>{
/**
* find.
* @param subs subs
* @param contents contents
* @param pageable pageable
* @return Page
*/
Page<Article> findBySubjectInOrContentIn(List<String> subs, List<String> contents, Pageable pageable);

/**
* count.
* @param subs subs
* @param contents contents
* @return Long
*/
Long countBySubjectInOrContentIn(List<String> subs, List<String> contents);

}